<template>
</template>

<script setup>
	import cache from '@/utils/cache';
	import util from '@/utils/util';
	import {
		ref,
		reactive,
		toRefs,
		inject
	} from 'vue';
	import {
		onLoad,
		onShow,
		onReady,
		onPullDownRefresh,
		onReachBottom,
	} from '@dcloudio/uni-app';

	const state = reactive({
		title: '初始页',
		themeColor: {
			theme: '#0055ff',
		},
	});

	//在页面所有元素加载完成后执行（只执行一次）
	onLoad((opt) => {
		util.getTheme();
		util.getSystemInfo();
		state.themeColor = cache.get('themeColor');

		util.checkLogin();
	});

	//在页面由不可见变为可见时执行（只要页面显示都会执行）
	onShow(() => {});

	//在页面解析完成之后执行
	onReady(() => {});

	function pageRoute(url) {
		uni.navigateTo({
			url
		});
	}

	function pageTabRoute(url) {
		uni.reLaunch({
			url
		});
	}

	const {
		title,
		themeColor,
	} = toRefs(state);
</script>

<style lang="scss">
</style>